[Serve] Preserve deployment metadata on wrapper classes#58478
[Serve] Preserve deployment metadata on wrapper classes#58478abrarsheikh merged 10 commits intoray-project:masterfrom
Conversation
Signed-off-by: teddygood <ibear6954@gmail.com>
Signed-off-by: teddygood <ibear6954@gmail.com>
Signed-off-by: teddygood <ibear6954@gmail.com>
There was a problem hiding this comment.
Code Review
This is a solid pull request that correctly addresses the issue of preserving metadata on wrapper classes in Ray Serve. The introduction of the copy_class_metadata utility function is a clean way to centralize this logic, and its application in the ingress and task_consumer decorators is appropriate. The new tests are well-written and provide good coverage for the added functionality, ensuring that attributes like __name__, __qualname__, __module__, __doc__, and __annotations__ are correctly propagated. The changes improve the introspection capabilities of Serve deployments and are a welcome enhancement.
Signed-off-by: teddygood <ibear6954@gmail.com>
Signed-off-by: teddygood <ibear6954@gmail.com>
|
Hi @abrarsheikh |
Fixes #58240, Related to #57664
Ensure Serve wrapper classes preserve original class metadata. Wrappers now copy
__qualname__,__module__,__doc__,__annotations__, and__wrapped__in addition to__name__. Added tests to verify metadata preservation fortask_consumerandingressdecorators.